﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Reflection;
using System.Text;
using sdf;

namespace sdf.Code
{
	public abstract class Entity_Base
	{
		/// <summary>
		/// Throws ArgumentOutOfRangeException exception if field length exceeded
		/// </summary>
		/// <param name="sObjectName"></param>
		/// <param name="iCurrentLength"></param>
		/// <param name="iMaxLength"></param>
		public static void ValidateFieldLength(string sObjectName, int iCurrentLength, int iMaxLength)
		{
			if (iCurrentLength > iMaxLength)
			{
				throw new ArgumentOutOfRangeException("value", sObjectName + " length is " + iCurrentLength + ". Maximum length is " + iMaxLength);
			}
		}
	}

}
